home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_01
/
1001127b
< prev
next >
Wrap
Text File
|
1991-11-17
|
647b
|
33 lines
#include <iostream.h>
#include <conio.h>
class Conbuf : public streambuf
{
int do_sputn(const char *s,int n);
int overflow(int=EOF);
} conbuf;
int Conbuf::overflow(int c)
{
do_sputn((char *)&c,1);
return 1;
}
int Conbuf::do_sputn(const char *s,int n)
{
int n1=n;
while (n1--)
{
putch(*s);
if (*s++=='\n')
{
putch('\r');
clreol();
}
}
return n;
}
ostream conout=&conbuf;